namespace Example.Models
{
    using SimpleWebServices;
    using SimpleWebServices.Data;
    using SimpleWebServices.Web.UI.Html;
    using Xunit;

    public sealed class RegistrationFormFacts
    {
        [Fact]
        public void typedef()
        {
            Assert.True(new ObjectExpectations<RegistrationForm>()
                .DerivesFrom<FormContainer>()
                .IsConcreteClass()
                .IsSealed()
                .HasDefaultConstructor()
                .XmlRoot("container")
                .Result);
        }

        [Fact]
        public void ctor()
        {
            Assert.NotNull(new ContactForm());
        }

        [Fact]
        public void op_Complete_FormSession()
        {
            /// TODO : test required
        }

        [Fact]
        public void op_Complete_FormSessionNull()
        {
            /// TODO : test required
        }

        [Fact]
        public void op_TemplateOfT()
        {
            FakeRepository.Clear();

            try
            {
                FakeRepository.Register<RegistrationForm>(new
                {
                    urn = "urn://simplewebservices.org/form/registration",
                    xml = "<container />"
                });

                Assert.NotNull(new RegistrationForm().Template<RegistrationForm>());
            }
            finally
            {
                FakeRepository.Reset();
            }
        }
    }
}